<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_文字溢出替换为省略号</title>
    <style>
        div {
            width: 200px;
            background-color: #ff0;
            /*以下三局是组合代码 缺一不可*/
            white-space: nowrap;  /*强制不换行*/
            overflow: hidden;  /*溢出隐藏*/
            text-overflow: ellipsis;  /*有溢出的文字显示省略号*/
        }
    </style>
</head>
<body>
    <div title="Lorem ipsum dolor sit amet, consectetur adipisicing elit">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus expedita nostrum odio quo sequi ut. Eligendi error excepturi magni possimus quia quidem, temporibus velit. Eveniet impedit iste nihil ratione sunt?
    </div>
</body>
</html>